<?php include "coresection/connection.php";?>
<?php include "coresection/checkSession.php";?>
<?php include "coresection/order-list.php";?>
<?php include "coresection/month-user-list.php";?>
<?php include "coresection/month-count.php";?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include 'modules/head.php'; ?>
</head>

<body>
<?php include 'modules/topbar.php'; ?>

<div class="setup_area">
    <?include 'modules/sidebar-admin.php'?>

    <div class="header">
        <h1>银行代扣伙食费</h1>
        <?php include 'modules/header.php'; ?>
    </div>


    <div class="content_area">



<div class="main">



    <form action="admin_statistics_countor_cost.php" method="post" autocomplete="off" enctype="multipart/form-data">


     <div style="margin-top: 10px; height: 1px;"></div>
        就餐时间：<select name="year">
		
			<? if($_REQUEST["year"]){?>
            <option value="<?echo $_REQUEST["year"];?>"  ><?echo $_REQUEST["year"];?></option>
            <? ;}
			else{ 
			?>
			
			<option value="<?echo date("Y")?>"  ><?echo date("Y")?></option>
			<?
			}
			?>
			
            <option value="<?echo date("Y",time())?>"><?echo date("Y",time())?></option>
            <option value="<?echo date("Y",time())-1?>"><?echo date("Y",time())-1?></option>
        </select>
        年


        <select name="month">

            <? if($_REQUEST["month"]){?>
            <option value="<?echo $_REQUEST["month"];?>" class="month_1"><?echo $_REQUEST["month"];?></option>
            <? ;}
			else{ 
			?>
			
			<option value="<?echo date("m")?>" class="month_<?echo date("m")?>"><?echo date("m")?></option>
			<?
			}
			?>

            <option value="01" class="month_1">01</option>
            <option value="02" class="month_2">02</option>
            <option value="03" class="month_3">03</option>
            <option value="04" class="month_4">04</option>
            <option value="05" class="month_5">05</option>
            <option value="06" class="month_6">06</option>
            <option value="07" class="month_7">07</option>
            <option value="08" class="month_8">08</option>
            <option value="09" class="month_9">09</option>
            <option value="10" class="month_10">10</option>
            <option value="11" class="month_11">11</option>
            <option value="12" class="month_12">12</option>
        </select>
        月

        <input type="submit" value="查看"/>

    </form>
    <div class="printArea <?if($_SESSION['userterm']==1){?>caiwuShow<?}?>">


        <ul class="caise"></ul>


        <table cellspacing="0" cellpadding="0" border="0" class="checkTable admin_list_table">
            <thead>
            <tr>
                <td>编号</td> 
                <td>姓名</td>
                <td>帐号</td>  
                <td>早餐金额</td>
                <td>饭餐金额</td>
                <td>合计</td>
                <td>实扣</td>
                <td>备注</td>
            </tr>
            </thead>
            <tbody>

             
      
	  <?
	  $endcount=$nowpageid*20;
	  if($endcount>$sum)
	  {$endcount=$sum;}
	  ?>
	  
            <? for($_i=($nowpageid-1)*20;$_i<$endcount;$_i++){?>
                <tr >
                    <td><? echo $_i+1 ?></td> 
                    <td><? echo $admin_user_name[$_i] ?></td>
                    <td><? echo $admin_user_account[$_i] ?></td>  
                    <td><? echo $admin_user_zaocan_cost[$_i] ?></td>
 
                   
                     <td><?  $fancoust=$admin_user_wucan_cost[$_i]+$admin_user_wancan_cost[$_i]; 
					 if($fancoust==0)
					 {$fancoust="";}
					 echo $fancoust?>
					 
					 </td>
					 <td><? echo $admin_user_zaocan_cost[$_i]+$admin_user_wucan_cost[$_i]+$admin_user_wancan_cost[$_i] ?></td>
					 
                     <td><? echo ($admin_user_zaocan_cost[$_i]+$admin_user_wucan_cost[$_i]+$admin_user_wancan_cost[$_i]) *0.3?></td>
                    <td></td>
                </tr>
            <? ;} ?>



            </tbody>
        </table>
		
		
		<div>
		<div class="page-guide">
<? $url="admin_statistics_countor_cost.php" ?>
		
    <?php
    if ($nowpageid == 1) {
        ?>
        <!--现在页数在第一页的时候-->
        <span>首页</span>
       <span> 上一页 </span>
        <!--现在页数非第一页的时候-->
    <?php
    } else {
        ?>
     
                <!--现在页数非第一页的时候-->
        <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo 1;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  首页 </a>

        <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $prepage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  上一页 </a>


        <!--现在页数非第一页的时候-->
    <?php
    }
    ?>




    <!--开始列印出所有页码-->
    <div class="pages_num">
    <?php
    $ii = 1; //用来和总页数比较。当等于总页数的时候就会停止循环
    $iii = 1;


    //如果存在省略页面的情况，就输出省略号
    if (($ii + 3) < $nowpageid) {
        echo "<span class='ell'>...</span>";
    }

    while ($ii <= $page_count) {
        //首先判断是不是当前页

        if ($ii == $nowpageid) {
            echo "<span>" . $ii . "</span>";
        } //和当前页数相差3页的页码不显示。目的是为了防止页码过多。
        else if ((($ii + 3) < $nowpageid) || (($ii - 3) > $nowpageid)) {
        } else {
            echo "<a href='";
            echo $url;

            echo "?nowpageid=";
            echo $iii;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
		 
			
			
            echo "'>";
            echo $iii;
            echo "</a>";
        }

        $ii++;
        $iii++;
    }
    ?>

    <!--列印出所有页码 结束-->


    <?
    //如果存在省略页面的情况，就输出省略号

    if (($ii - 3) > $nowpageid) {
        echo "<span class='ell'>...</span>";
    }
    ?>
    </div>

    <?php
    if ($nowpageid == $page_count) {
        ?>
        <!--现在页数在第一页的时候-->
        <span> 下一页 </span>
        <span>末页</span>
        <!--现在页数非第一页的时候-->
    <?php
    } else {
        ?>
        <!--现在页数非第一页的时候-->

         <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $nextpage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  下一页 </a>
		  
		  
         <a href="
		
		 <?  
            echo $url."?nowpageid=";
            echo $lastpage;


			echo "&&year=";
            echo $count_year;
			
			echo "&&month=";
            echo $count_month;
          ?>
		  ">
		  末页 </a>
		  
		   
        <!--现在页数非第一页的时候-->
    <?php
    }
    ?>


</div>
<!--翻页代码结束--></div>
    </div>
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
        <?php include 'modules/footer.php'; ?>
</body>
</html>